test_cases = int(input())
total=[]
for test in range(test_cases):
elements=int(input())
sequence = list(map(int,input().split()))
for index,number in enumerate(sequence):
if len(sequence)==1:
total.append(sequence[0])
break
if len(sequence)%2!=0:
total.append(str(sequence[index])+" "+str(sequence[len(sequence)-index-1]))
if len(sequence)-index-1 == index:
str1=total[-1]
total[-1] = str1.split(" ")[0]
break
else:
total.append(str(sequence[index])+" "+str(sequence[len(sequence)-index-1]))
if (len(sequence)-index-1) - index ==1:
break
print(*total)
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int arr[n];
for(int i=0; i<n; i++)
{
cin>>arr[i];
}
for(int i=0; i<n/2; i++)
{
cout<<arr[i]<<" "<<arr[n-i-1]<<" ";
}
if(n%2!=0)
{
cout<<arr[n/2];
}
cout<<endl;
}
}
1585C - Minimize Distance | 1506E - Restoring the Permutation |
1539A - Contest Start | 363D - Renting Bikes |
1198D - Rectangle Painting 1 | 1023B - Pair of Toys |
1725A - Accumulation of Dominoes | 1675E - Replace With the Previous Minimize |
839A - Arya and Bran | 16B - Burglar and Matches |
1625B - Elementary Particles | 1725G - Garage |
1725B - Basketball Together | 735A - Ostap and Grasshopper |
1183B - Equalize Prices | 1481A - Space Navigation |
1437B - Reverse Binary Strings | 1362B - Johnny and His Hobbies |
1299A - Anu Has a Function | 1111A - Superhero Transformation |
954A - Diagonal Walking | 39F - Pacifist frogs |
1451C - String Equality | 386A - Second-Price Auction |
1690E - Price Maximization | 282B - Painting Eggs |
440A - Forgotten Episode | 233B - Non-square Equation |
628B - New Skateboard | 262B - Roma and Changing Signs |